package com.beteng.su.betengsu.adapter;

import android.content.Context;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.beteng.su.betengsu.R;
import com.beteng.su.betengsu.bean.OrderTranceBean;


import butterknife.BindView;
import butterknife.ButterKnife;
import cn.droidlover.xdroid.base.SimpleRecAdapter;

/**
 * Created by chenzhimin on 2017/9/6.
 */

public class ItemDetailAdapter extends SimpleRecAdapter<OrderTranceBean, ItemDetailAdapter.ViewHolder> {
    public ItemDetailAdapter(Context context) {
        super(context);
    }

    @Override
    public void onBindViewHolder(final ViewHolder holder, final int position) {

        final OrderTranceBean orderTranceBean = getDataSource().get(position);
        holder.mItemDetailStatus.setText(orderTranceBean.getStatus()+"");
        holder.mItemDetailTime.setText(orderTranceBean.getOccurDateTime()+"");
        holder.mItemDetailPlace.setText(orderTranceBean.getAreaName()+"");
        holder.mItemDetailRemark.setText(orderTranceBean.getDescription()+"");




    }

    @Override
    public ViewHolder newViewHolder(View itemView) {
        return new ViewHolder(itemView);
    }


    @Override
    public int getLayoutId() {
        return R.layout.item_detail_info;
    }





    static class ViewHolder extends RecyclerView.ViewHolder {
        @BindView(R.id.item_detail_status)
        TextView mItemDetailStatus;
        @BindView(R.id.item_detail_time)
        TextView mItemDetailTime;
        @BindView(R.id.item_detail_place)
        TextView mItemDetailPlace;
        @BindView(R.id.item_detail_remark)
        TextView mItemDetailRemark;
        @BindView(R.id.search_item_layout)
        CardView mSearchItemLayout;

        ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }
    }
}
